1. address: A static address with just the functionality of holding a
20-byte value (size of an Ethereum address).
2. address payable: It’s an address with additional members as
transfer and send with the support for the functionalities of
transferring and sending the Ethers.
2.5.10.2 Reference Type
Complex data types as arrays, structs, etc., that are far bigger than
256 bits in size needs to be handled with more care than the types
passed by value. Such types, known as reference types, are also
saved with special keywords such as storage (persistent store) or
memory (non-persisting store).
Now, let’s explore the types that fall under the reference type.
2.5.10.2.1 Array
An Array is a data type which carries a group of data of the same
value, such as type byte, string, int, uint etc. An array can be created
with a fixed length that we assign at the time of declaration or the
variable length type. Arrays can also be dynamic where no size is
allocated and it can grow gradually with the addition of more data.
Refer to the following example code:
uint[5] marks = [10, 20, 30, 40, 50];
If it’s a state variable, then we have to declare with a storage
keyword, so that it can be saved in a permanent location, as shown
as follows:
// SPDX-License-Identifier: Some Identifier
pragma solidity ^0.8.10;
contract Types {
uint[5] score;
function getScore() public returns (uint[5]memory){
score = [10, 20, 30, 40, 50];
return score;
}